package com.p2p.auth.service.lifeCycle;import com.p2p.auth.domain.entity.User;import com.p2p.auth.domain.dto.user.LoginResponseDTO;import org.springframework.util.Assert;import java.text.SimpleDateFormat;/** * Description: * author: 慢慢来了 * date:  2017/4/13 11:59 */public class LoginUtils {    private static  SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");    public static LoginResponseDTO copyToDTO(User u){        Assert.notNull(u, "The given user must not be null!");        //Assert.notNull(u.getRealName(), "The given user phoneNum must not be null!");        LoginResponseDTO dto = new LoginResponseDTO();        dto.setPhoneNum(u.getPhoneNum());        dto.setUserId(u.getUserId());        dto.setUserName(u.getRealName());        return dto;    }}